<style>
    .layui-card:last-child {
        width: 95%;
        /* min-height: 900px; */
        margin: 0 auto;
        margin-top: 32px;
        border-radius: 8px;
        padding: 10px 0px;
        box-sizing: border-box;
    }
    
    .zhuangtai {
        float: left;
        font-size: 18px;
        margin-right: 12px;
    }
    
    .sanbut {
        float: right;
        display: flex;
        justify-content: space-around;
        align-items: center;
        /* position: absolute;
        right: 0;
        top: 0; */
    }
    
    .layui-btn-normal {
        background-color: #FFFFFF;
        color: black;
        border: 1px solid #DCDFE6;
    }
    
    .bai {
        background-color: #FFFFFF;
        color: black;
        border: 1px solid #DCDFE6;
    }
    
    th {
        border: transparent !important;
    }
    
    tr {
        border-bottom: 1px solid #F5F5F5;
    }
    
    .layui-btn-danger {
        background-color: #F87C7E;
    }
    
    .aa {
        border-radius: 8px;
        background-color: #F5F5F5;
        padding-left: 10px;
        color: black;
    }
    
    .bb {
        background-color: #06B991;
        display: inline-block;
        width: 90px;
        height: 38px;
        line-height: 38px;
        padding: 0 18px;
        /* background-color: transparent; */
        color: #fff;
        white-space: nowrap;
        text-align: center;
        font-size: 14px;
        border: none;
        /* border-radius: 2px; */
        cursor: pointer;
        border-radius: 8px;
        /* border: 1px solid #DCDFE6; */
        margin-right: 10px;
    }
    
    .layui-btn {
        display: inline-block;
    }
    
    .cc {
        min-width: 190px;
        font-size: 15px;
    }
    
    .minbox {
        min-height: 500px;
        height: 200px;
        margin: 14px 0;
        padding: 0 30px;
    }
    
    .layui-layer-page .layui-layer-content {
        width: 100%;
        margin: 0 auto;
    }
    
    .zuobiao {
        width: 100%;
        text-align: center;
        font-size: 22px;
        margin: 23px 0;
    }
    
    .xy {
        font-size: 18px;
        width: 100%;
        text-align: center;
        margin-top: 12px;
    }
    
    .xy>input {
        margin-left: 22.5px;
        border-radius: 8px;
        background-color: #F5F5F5;
        height: 24.5px;
        width: 162px;
        padding-left: 10px;
        border: none;
    }
    
    .put>input {
        margin-left: 5.5px;
        border-radius: 8px;
        background-color: #F5F5F5;
        height: 24.5px;
        width: 162px;
        padding-left: 10px;
        border: none;
    }
    
    .xy>input::placeholder {
        font-size: 15px;
    }
    
    .liangbut {
        margin-top: 29.5px;
        display: flex;
        justify-content: center;
    }
    
    tr {
        border: 1px solid #F5F5F5;
    }
    
    .layui-this {
        background-color: #FEA858;
        color: #fff !important;
    }
    
    .layui-tab-title {
        border: none;
    }
    
    .layui-tab-title .layui-this:after {
        border: none;
    }
    
    .xian {
        width: 70%;
        height: 20px;
        margin: 24px auto;
        color: #06B991;
        font-size: 18px;
        text-align: center;
        line-height: 20px;
        background: url(https://njyyl.oss-cn-hangzhou.aliyuncs.com/images/xian.png?versionId=CAEQIRiBgICZl9Gu4RciIDk5ODA5OGY4Mzg5OTRkYWU5ZmVjNzllZTBiNGY0YmU5) no-repeat;
    }
    
    .list {
        width: 100%;
    }
    
    .son {
        width: 129px;
        height: 129px;
        background: url(https://njyyl.oss-cn-hangzhou.aliyuncs.com/images/yuan.png?versionId=CAEQIRiBgMCSl9Gu4RciIDc1ODM2YjY1Mjk0MzQ5NWZhN2E3MzViZjVmM2IzNmY1) no-repeat;
        background-size: 100% 100%;
        /* line-height: 129px; */
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        float: left;
        margin: 12px 12px 0 0;
        cursor: pointer;
    }
    
    .sonwc {
        width: 129px;
        height: 129px;
        background: url(https://njyyl.oss-cn-hangzhou.aliyuncs.com/images/yuan.png?versionId=CAEQIRiBgMCSl9Gu4RciIDc1ODM2YjY1Mjk0MzQ5NWZhN2E3MzViZjVmM2IzNmY1) no-repeat;
        background-size: 100% 100%;
        /* line-height: 129px; */
        text-align: center;
        float: left;
        margin: 12px 12px 0 0;
        cursor: pointer;
    }
    
    .dd {
        background-color: #FEA858;
    }
    /*二级菜单样式修改*/
    
    .baba li {
        border: 1px solid #F2F3F6;
        border-radius: 10px;
        color: black;
        display: inline-block;
        width: 80px;
        height: 38px;
        line-height: 38px;
        padding: 0 18px;
        white-space: nowrap;
        text-align: center;
        font-size: 14px;
        cursor: pointer;
        border-radius: 8px;
        margin-right: 8px;
    }
    
    .erzi li {
        background-color: white !important;
        color: black !important;
        border: 1px solid #DCDFE6;
        border-radius: 23px;
        display: inline-block;
        width: 60px;
        height: 30px;
        font-size: 16px;
        line-height: 30px;
        padding: 0 13px;
        white-space: nowrap;
        margin-right: 5px;
    }
    
    .erzi .layui-this {
        border: none;
        color: #8DDFCC !important;
        box-shadow: 0px 2px 6px 0px rgba(6, 185, 145, 0.12);
    }
    
    .cansu {
        width: 211px;
        height: 215px;
        background: url(https://njyyl.oss-cn-hangzhou.aliyuncs.com/images/kuang.png?versionId=CAEQIRiBgICmosG94RciIGJmYzIxMjBhMDg5MzQxODRhNDEwNWRkZTI3OTJhM2Vj) no-repeat;
        background-size: 100% 100%;
        margin-right: 12.5px;
        margin-bottom: 15px;
        float: left;
    }
    
    .maxcansu {
        width: 433.75px;
        height: 124.4px;
        background: url(https://njyyl.oss-cn-hangzhou.aliyuncs.com/images/maxkuang.png?versionId=CAEQIRiBgIDY_qa.4RciIGNmYWQyYWNjZGFjYTRkMzA5N2IyY2UzNjQ2MWVlMmE3) no-repeat;
        background-size: 100% 100%;
        margin-right: 12.5px;
        margin-bottom: 15px;
        float: left;
    }
    
    .kuang {
        display: flex;
        justify-content: space-around;
        align-items: center;
        font-size: 15px;
        height: 30px;
    }
    
    .kuangall {
        padding: 15px;
    }
    
    .maxkuang {
        padding: 15px 10px;
    }
    
    .minput {
        width: 61px;
        background-color: #F5F5F5;
        border: 1px solid #DCDFE6;
        color: #06B991;
        text-align: center;
    }
    
    .bcby {
        width: 100%;
        text-align: center;
        position: absolute;
        bottom: 10px;
        left: 0;
        right: 0;
        margin: auto;
    }
    
    .bian {
        box-shadow: 0px 2px 6px 0px rgba(6, 185, 145, 0.2);
    }
    
    th,
    td {
        text-align: center;
    }
    
    .layui-table th {
        font-weight: 100;
        color: black;
    }
    
    .leftbiao {
        width: 49%;
        margin: 12px 12px 0 0;
        box-shadow: 0px 2px 6px 0px rgba(6, 185, 145, 0.2);
        padding-bottom: 10px;
        box-sizing: border-box;
        float: left;
    }
    
    .rightbiao {
        width: 49%;
        margin: 12px 0 0 0;
        box-shadow: 0px 2px 6px 0px rgba(6, 185, 145, 0.2);
        padding-bottom: 10px;
        box-sizing: border-box;
        float: right;
    }
    
    .dibulan {
        width: 90%;
        margin: 5px auto;
        font-size: 16px;
        border-radius: 4px;
        text-align: center;
        height: 46px !important;
    }
    
    .divhui {
        background-color: #F5F5F5;
        width: 221px;
        height: 46;
        float: left;
        margin-right: 12px;
        border-radius: 5px;
    }
    
    .dibukg {
        position: relative;
        width: 10px;
        float: right;
        margin-right: 20px;
    }
    
    .hdtext {
        width: 90%;
        margin: 0 auto;
        font-size: 18px;
        font-weight: 600;
    }
    
    .tbodyf td,
    .tbodyf th {
        color: red;
    }
    
    .tbodyf>tr>td {
        text-align: left !important;
    }
    
    .layui-tab-content {
        margin-top: 1%;
    }
    
    .layui-form-select .layui-input {
        border-radius: 8px;
        background-color: #F5F5F5;
    }
</style>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="layadmin-useradmin-formlist">
            <div class="layui-form-item">
                <!-- 用户名搜索 -->
            </div>
            <div class="layui-tab" style="margin-top: 0px;">
                <div style="float: left;">
                    <div class="zhuangtai">状态：</div>
                    <ul class="layui-tab-title erzi">
                        <li class="layui-this">全部</li>
                        <li>待处理</li>
                        <li>处理中</li>
                        <li>已处理</li>
                    </ul>
                </div>
                <div style="float: left;margin-left: 10%;">
                    <div class="layui-inline">
                        <div class="layui-form-item">
                            <div class="layui-input-inline">
                                <select name="interest-search" id="soso" lay-filter="interest-search" lay-search style="background-color: #F5F5F5;">
                            </select>
                            </div>
                        </div>
                    </div>
                </div>


                <div style="float: right;">
                    <div class="sanbut">
                        <button class="layui-btn layuiadmin-btn-useradmin bb" style="float: right;margin-left: 10px;" data-type="add" id="add">新增</button>
                    </div>
                </div>
                <div style="clear: both;"></div>
                <div class="layui-tab-content">
                    <!-- 全部 -->
                    <div class="layui-tab-item layui-show">
                        <div style="min-height: 500px;">
                            <table id="LAY-app-message-all" lay-filter="LAY-app-message-all"></table>
                            <script type="text/html" id="table-useradmin-all">
                                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit">编辑</a>
                                <a class="layui-btn layui-bg-red layui-btn-sm" lay-event="del">删除</a>
                            </script>
                        </div>
                        <div id="demo5" style="text-align: center;margin: 20px auto;"></div>
                    </div>

                    <div class="layui-tab-item">
                        <div style="min-height: 500px;">
                            <table id="LAY-app-message-notice" lay-filter="LAY-app-message-notice"></table>
                            <script type="text/html" id="table-useradmin-allwhz">
                                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit">编辑</a>
                                <a class="layui-btn layui-bg-red layui-btn-sm" lay-event="delwhz">删除</a>
                            </script>
                        </div>
                        <div id="demo4" style="text-align: center;margin: 20px auto;"></div>
                    </div>
                    <div class="layui-tab-item">
                        <div style="min-height: 500px;">
                            <table id="LAY-app-message-notice-gongkongban" lay-filter="LAY-app-message-notice-gongkongban"></table>
                            <script type="text/html" id="table-useradmin-alldcl">
                                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit">编辑</a>
                                <a class="layui-btn layui-bg-red layui-btn-sm" lay-event="delwhz">删除</a>
                            </script>
                        </div>
                        <div id="demo3" style="text-align: center;margin: 20px auto;"></div>
                    </div>
                    <div class="layui-tab-item">
                        <div style="min-height: 500px;">
                            <table id="LAY-app-message-noticeyijieshu" lay-filter="LAY-app-message-noticeyijieshu"></table>
                            <script type="text/html" id="table-useradmin-allyjs">
                                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit">编辑</a>
                                <a class="layui-btn layui-bg-red layui-btn-sm" lay-event="delwhz">删除</a>
                            </script>
                        </div>
                        <div id="demo2" style="text-align: center;margin: 20px auto;"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    layui.use('useradmin', layui.factory('useradmin')).use(['admin', 'useradmin', 'table', "laypage", 'laydate', 'layer'], function() {
        var $ = layui.$,
            admin = layui.admin,
            view = layui.view,
            setter = layui.setter,
            table = layui.table,
            laydate = layui.laydate,
            layer = layui.layer,
            laypage = layui.laypage,
            form = layui.form;


        form.render(null, 'layadmin-userfront-formlist');
        //监听搜索
        form.on('submit(LAY-user-back-search)', function(data) {

            var field = data.field;
            //执行重载
            table.reload('LAY-app-message-all', {
                where: field
            });
            table.reload('LAY-app-message-notice-gongkongban', {
                where: field
            });
            table.reload('LAY-app-message-notice', {
                where: field
            });
            table.reload('LAY-app-message-noticeyijieshu', {
                where: field
            });
        });

        //事件
        var active = {

        };
        admin.req({
            url: setter.request.baseUrl + "agv-info/query",
            data: JSON.stringify({
                pageNum: 1,
                pageSize: 100
            }),
            type: "POST",
            dataType: "json",
            contentType: "application/json;charset=UTF-8",
            done: function(res) {
                console.log(res);
                var html = "<option style='color:#e6e6e6;' value=''>请选择车辆编号</option>";
                for (i = 0; i < res.info.length; i++) {
                    html += "<option value=" + res.info[i].agvId + ">" + res.info[i].agvId + "</option>"
                }
                $("#soso").empty().append(html)
                form.render('select'); //需要渲染一下
            },

        });
        //事件下拉框数据发生变化时
        form.on('select(interest-search)', function(data) {
            // 调用搜索函数
            var data_val = data.value; //当前选中的数据
            if (data_val == "") {
                // 查询所有的数据,不传的时候就是查询所有的
                getData(1, '')
                getDataI(1, '')
                getDataII(1, '')
                getDataIII(1, '')
            } else {
                getData(1, data_val)
                getDataI(1, data_val)
                getDataII(1, data_val)
                getDataIII(1, data_val)
            }
            console.log(data);

        });


        //提现表格
        if (localStorage.getItem("role") == "平台管理员") {

        } else {
            //全部
            getData(1, '')

            function getData(pageNum, agvId) {
                table.render({
                    //接口
                    elem: "#LAY-app-message-all",
                    url: setter.request.baseUrl + "agv-alarm/query",
                    data: JSON.stringify({
                        a: 111
                    }),
                    where: {
                        pageNum: pageNum,
                        pageSize: 10,
                        agvId: parseInt(agvId)
                    },
                    contentType: "application/json;charset=UTF-8",
                    method: "POST",
                    response: {
                        statusName: "code",
                        statusCode: 0,
                        msgName: "msg",
                        countName: "totalCount",
                        dataName: "info",
                    },
                    page: false,
                    done: function(res, curr, count) {
                        console.log(res)
                        laypage.render({
                            elem: 'demo5',
                            count: res.pageResponseDTO.total,
                            curr: pageNum,
                            limit: 10,
                            jump: function(obj, first) {
                                if (!first) {
                                    // that.shuju.pageNum = obj.curr;
                                    getData(obj.curr)
                                }
                            }
                        });
                    },
                    cols: [
                        [{
                            field: "agvId",
                            title: "车辆编号",
                            align: 'center',
                            width: '10%',
                        }, {
                            field: "code",
                            align: 'center',
                            title: "故障码"
                        }, {
                            field: "remark",
                            align: 'center',
                            title: "故障描述",
                            templet: "#remark",
                        }, {
                            field: "status",
                            align: 'center',
                            title: "处理状态",
                            templet: "#status"
                        }, {
                            field: "time",
                            align: 'center',
                            title: "故障时间"
                        }, {
                            field: "optTime",
                            align: 'center',
                            title: "处理时间"
                        }, {
                            field: "operator",
                            align: 'center',
                            title: "处理人员"
                        }, {
                            fixed: "right",
                            align: 'center',
                            width: '10%',
                            title: "操作",
                            toolbar: "#table-useradmin-all"
                        }],
                    ],
                });

            }
        }
        //维护中

        getDataII(1, '')


        function getDataII(pageNum, agvId) {
            table.render({
                //接口
                elem: "#LAY-app-message-notice-gongkongban",
                url: setter.request.baseUrl + "agv-alarm/query",
                data: JSON.stringify({
                    a: 111
                }),
                where: {
                    pageNum: pageNum,
                    pageSize: 10,
                    agvId: parseInt(agvId),
                    'status': 1
                },
                contentType: "application/json;charset=UTF-8",
                method: "POST",
                response: {
                    statusName: "code",
                    statusCode: 0,
                    msgName: "msg",
                    countName: "totalCount",
                    dataName: "info",
                },
                page: false,
                done: function(res, curr, count) {
                    console.log(res)
                    laypage.render({
                        elem: 'demo3',
                        count: res.pageResponseDTO.total,
                        curr: pageNum,
                        limit: 10,
                        jump: function(obj, first) {
                            if (!first) {
                                // that.shuju.pageNum = obj.curr;
                                getDataII(obj.curr)
                            }
                        }
                    });
                },
                cols: [
                    [{
                        field: "agvId",
                        title: "车辆编号",
                        align: 'center',
                        width: '10%',
                    }, {
                        field: "code",
                        align: 'center',
                        title: "故障码"
                    }, {
                        field: "remark",
                        align: 'center',
                        title: "故障描述",
                        templet: "#remark",
                    }, {
                        field: "status",
                        align: 'center',
                        title: "处理状态",
                        templet: "#status"
                    }, {
                        field: "time",
                        align: 'center',
                        title: "故障时间"
                    }, {
                        field: "optTime",
                        align: 'center',
                        title: "处理时间"
                    }, {
                        field: "operator",
                        align: 'center',
                        title: "处理人员"
                    }, {
                        fixed: "right",
                        align: 'center',
                        title: "操作",
                        width: '10%',
                        toolbar: "#table-useradmin-allwhz"
                    }],
                ],
            });

        }
        //代维护
        getDataI(1, '')


        function getDataI(pageNum, agvId) {
            table.render({
                //接口
                elem: "#LAY-app-message-notice",
                url: setter.request.baseUrl + "agv-alarm/query",
                data: JSON.stringify({
                    a: 111
                }),
                where: {
                    pageNum: pageNum,
                    pageSize: 10,
                    'status': 0,
                    agvId: parseInt(agvId)
                },
                contentType: "application/json;charset=UTF-8",
                method: "POST",
                response: {
                    statusName: "code",
                    statusCode: 0,
                    msgName: "msg",
                    countName: "totalCount",
                    dataName: "info",
                },
                page: false,
                done: function(res, curr, count) {
                    console.log(res)
                    laypage.render({
                        elem: 'demo4',
                        count: res.pageResponseDTO.total,
                        curr: pageNum,
                        limit: 10,
                        jump: function(obj, first) {
                            if (!first) {
                                // that.shuju.pageNum = obj.curr;
                                getDataI(obj.curr)
                            }
                        }
                    });
                },
                cols: [
                    [{
                        field: "agvId",
                        title: "车辆编号",
                        align: 'center',
                        width: '10%',
                    }, {
                        field: "code",
                        align: 'center',
                        title: "故障码"
                    }, {
                        field: "remark",
                        align: 'center',
                        title: "故障描述",
                        templet: "#remark",
                    }, {
                        field: "status",
                        align: 'center',
                        title: "处理状态",
                        templet: "#status"
                    }, {
                        field: "time",
                        align: 'center',
                        title: "故障时间"
                    }, {
                        field: "optTime",
                        align: 'center',
                        title: "处理时间"
                    }, {
                        field: "operator",
                        align: 'center',
                        title: "处理人员"
                    }, {
                        fixed: "right",
                        align: 'center',
                        width: '10%',
                        title: "操作",
                        toolbar: "#table-useradmin-alldcl"
                    }],
                ],
            });
        }

        //已结束
        getDataIII(1, '')

        function getDataIII(pageNum, agvId) {
            table.render({
                //接口
                elem: "#LAY-app-message-noticeyijieshu",
                url: setter.request.baseUrl + "agv-alarm/query",
                data: JSON.stringify({
                    a: 111,
                }),
                where: {
                    pageNum: pageNum,
                    pageSize: 10,
                    agvId: parseInt(agvId),
                    'status': 2
                },
                contentType: "application/json;charset=UTF-8",
                method: "POST",
                response: {
                    statusName: "code",
                    statusCode: 0,
                    msgName: "msg",
                    countName: "totalCount",
                    dataName: "info",
                },
                page: false,
                done: function(res, curr, count) {
                    console.log(res)
                    laypage.render({
                        elem: 'demo2',
                        count: res.pageResponseDTO.total,
                        curr: pageNum,
                        limit: 10,
                        jump: function(obj, first) {
                            if (!first) {
                                // that.shuju.pageNum = obj.curr;
                                getDataIII(obj.curr)
                            }
                        }
                    });
                },
                cols: [
                    [{
                        field: "agvId",
                        title: "车辆编号",
                        align: 'center',
                        width: '10%',
                    }, {
                        field: "code",
                        align: 'center',
                        title: "故障码"
                    }, {
                        field: "remark",
                        align: 'center',
                        title: "故障描述",
                        templet: "#remark",
                    }, {
                        field: "status",
                        align: 'center',
                        title: "处理状态",
                        templet: "#status"
                    }, {
                        field: "time",
                        align: 'center',
                        title: "故障时间"
                    }, {
                        field: "optTime",
                        align: 'center',
                        title: "处理时间"
                    }, {
                        field: "operator",
                        align: 'center',
                        title: "处理人员"
                    }, {
                        fixed: "right",
                        align: 'center',
                        title: "操作",
                        width: '10%',
                        toolbar: "#table-useradmin-allyjs"
                    }],
                ],
            });

        }
        //新增
        var active = {
            add: function() {
                console.log("aa")
                admin.popup({
                    title: '新增公司信息',
                    area: ["50%", "60%"],
                    id: 'layuiadmin-form-userform',
                    success: function(layero, index) {
                        view(this.id).render('product/form').done(function() {
                            form.render(null, 'layuiadmin-form-userform');
                            layui.laydate.render({
                                type: 'datetime',
                                elem: '#date' //指定元素
                            });
                            layui.laydate.render({
                                type: 'datetime',
                                elem: '#optTime' //指定元素
                            });
                            //监听提交
                            form.on('submit(LAY-user-back-submit)', function(data) {
                                var field = data.field; //获取提交的字段
                                //新增用户信息  
                                admin.req({
                                    url: setter.request.baseUrl + "agv-alarm/add",
                                    data: JSON.stringify({
                                        'agvId': field.agvId,
                                        'code': field.code,
                                        'operator': field.operator,
                                        'status': field.status,
                                        'optTime': field.optTime,
                                        'remark': field.remark,
                                        'time': field.time

                                    }),
                                    type: "POST",
                                    dataType: "json",
                                    contentType: "application/json;charset=UTF-8",

                                    done: function(res) {
                                        console.log('新增', res);
                                        layui.table.reload('LAY-app-message-all'); //重载表格
                                        layui.table.reload('LAY-app-message-noticeyijieshu'); //重载表格
                                        layui.table.reload('LAY-app-message-notice'); //重载表格
                                        layui.table.reload('LAY-app-message-notice-gongkongban'); //重载表格
                                        layer.close(index); //执行关闭 
                                        layer.msg(res.msg);
                                    },

                                });
                            });
                        });
                    }
                });
            }
        };
        $('.layui-btn.layuiadmin-btn-useradmin').on('click', function() {
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });


        $('.layui-btn.layuiadmin-btn-useradmin').on('click', function() {
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });
        //编辑删除
        table.on("tool(LAY-app-message-all)", function(obj) {
            var data = obj.data;
            if (obj.event === "edit") {
                admin.popup({
                    title: "编辑",
                    area: ["50%", "60%"],
                    success: function(layero, index) {
                        view(this.id)
                            .render("product/children", data)
                            .done(function() {
                                layui.laydate.render({
                                    type: 'datetime',
                                    elem: '#date' //指定元素
                                });
                                layui.laydate.render({
                                    type: 'datetime',
                                    elem: '#optTime' //指定元素
                                });
                                let _data = data;
                                form.render(null, "layuiadmin-form-userform");
                                form.on('submit(LAY-user-back-submit)', function(data) {
                                    var field = data.field;
                                    _data.adminreadstate = 1
                                        // warning
                                    editwworkHandle(Object.assign(_data, field));
                                    // layui.table.reload('LAY-user-back-manage'); //重载表格
                                    layer.close(index);
                                });
                            });
                    },
                });
            } else if (obj.event === "del") {
                layer.confirm("真的删除么", function(index) {
                    console.log(data)
                    delcardHandle({
                        idList: data.id,
                    });
                    obj.del();
                    layer.close(index);
                });
            }
        });
        //处理中
        table.on("tool(LAY-app-message-notice-gongkongban)", function(obj) {
            console.log('yang')
            var data = obj.data;
            if (obj.event === "edit") {
                admin.popup({
                    title: "编辑",
                    area: ["50%", "60%"],
                    success: function(layero, index) {
                        view(this.id)
                            .render("product/children", data)
                            .done(function() {
                                let _data = data;
                                form.render(null, "layuiadmin-form-userform");
                                form.on('submit(LAY-user-back-submit)', function(data) {
                                    var field = data.field;
                                    _data.adminreadstate = 1
                                        // warning
                                    editwworkHandle(Object.assign(_data, field));
                                    // layui.table.reload('LAY-user-back-manage'); //重载表格
                                    layer.close(index);
                                });
                            });
                    },
                });
            } else if (obj.event === "delwhz") {
                layer.confirm("真的删除么", function(index) {
                    console.log(data)
                    delcardHandlewhz({
                        idList: data.id,
                    });
                    obj.del();
                    layer.close(index);
                });
            }
        });
        table.on("tool(LAY-app-message-notice)", function(obj) {
            console.log('yang')
            var data = obj.data;
            if (obj.event === "edit") {
                admin.popup({
                    title: "编辑",
                    area: ["50%", "60%"],
                    success: function(layero, index) {
                        view(this.id)
                            .render("product/children", data)
                            .done(function() {
                                let _data = data;
                                form.render(null, "layuiadmin-form-userform");
                                form.on('submit(LAY-user-back-submit)', function(data) {
                                    var field = data.field;
                                    _data.adminreadstate = 1
                                        // warning
                                    editwworkHandle(Object.assign(_data, field));
                                    // layui.table.reload('LAY-user-back-manage'); //重载表格
                                    layer.close(index);
                                });
                            });
                    },
                });
            } else if (obj.event === "delwhz") {
                layer.confirm("真的删除么", function(index) {
                    console.log(data)
                    delcardHandlewhz({
                        idList: data.id,
                    });
                    obj.del();
                    layer.close(index);
                });
            }
        });
        table.on("tool(LAY-app-message-noticeyijieshu)", function(obj) {
            console.log('yang')
            var data = obj.data;
            if (obj.event === "edit") {
                admin.popup({
                    title: "编辑",
                    area: ["50%", "60%"],
                    success: function(layero, index) {
                        view(this.id)
                            .render("product/children", data)
                            .done(function() {
                                let _data = data;
                                form.render(null, "layuiadmin-form-userform");
                                form.on('submit(LAY-user-back-submit)', function(data) {
                                    var field = data.field;
                                    _data.adminreadstate = 1
                                        // warning
                                    editwworkHandle(Object.assign(_data, field));
                                    // layui.table.reload('LAY-user-back-manage'); //重载表格
                                    layer.close(index);
                                });
                            });
                    },
                });
            } else if (obj.event === "delwhz") {
                layer.confirm("真的删除么", function(index) {
                    console.log(data)
                    delcardHandlewhz({
                        idList: data.id,
                    });
                    obj.del();
                    layer.close(index);
                });
            }
        });
        //删除
        function delcardHandle(params) {
            console.log(params)
            admin.req({
                url: setter.request.baseUrl + "agv-alarm/delete",
                data: JSON.stringify({
                    idList: [params.idList]
                }),
                headers: {
                    'content-type': 'application/json',
                },
                type: "post",
                done: function(res) {
                    layer.msg(res.msg);
                },
            });
        }
        //删除
        function delcardHandlewhz(params) {
            console.log(params)
            admin.req({
                url: setter.request.baseUrl + "agv-alarm/delete",
                data: JSON.stringify({
                    idList: [params.idList]
                }),
                headers: {
                    'content-type': 'application/json',
                },
                type: "post",
                done: function(res) {
                    layer.msg(res.msg);
                },
            });
        }
        //修改编辑
        function editwworkHandle(parms) {
            admin.req({
                url: setter.request.baseUrl + "agv-alarm/update",
                data: JSON.stringify(parms),
                type: "post",
                dataType: "json",
                contentType: "application/json",
                done: function(res) {
                    layui.table.reload('LAY-app-message-all'); //重载表格
                    layui.table.reload('LAY-app-message-noticeyijieshu'); //重载表格
                    layui.table.reload('LAY-app-message-notice'); //重载表格
                    layui.table.reload('LAY-app-message-notice-gongkongban'); //重载表格
                    layer.close(index); //执行关闭 
                    layer.msg(res.msg);
                },
            });
        }
        $('.layui-btn.layuiadmin-btn-useradmin').on('click', function() {
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });

        // 故障描述
        $(document).on("click", ".table-check-img", function(e) {
            console.log(e.target.value)
            layer.open({
                type: 1,
                title: "故障描述",
                resize: false,
                content: '<div style="width: 90%;min-height: 100px;margin:10px auto">' + e.target.value + '</div>'
            });

        });
    });
</script>
<script type="text/html" id="status">
    {{# if(d.status ==0){}} {{# return '待处理'}} {{# } }} {{# if(d.status ==1){}} {{# return '处理中'}} {{# } }} {{# if(d.status ==2){}} {{# return '已处理'}} {{# } }}
</script>
<script type="text/html" id="remark">
    <button type="button" class="layui-btn layui-btn-xs table-check-img" value="{{ d.remark }}" data-remark="{{d.remark}}">查看</button>
</script>